<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>成绩信息</title>
<%@ include file="../../../web/header.jsp" %>
</head>
<body>
<div class="layui-collapse">
	
	
	<div class="layui-colla-content layui-show">
		<fieldset class="layui-elem-field layui-field-title"  >
	<legend >成绩信息</legend>
      <form class="layui-form">
      	<div class="layui-form-item">
      	 	
      	      <legend id="studentIdLed">学号： <%=request.getParameter("id") %></legend>
     
	
	<div class="layui-input-block" style="width: 7.5rem;">

		</div>
      	         
      	    	 <input  type="hidden" class="layui-btn" lay-submit lay-filter="select"  name="action" value="查询" style="width:80px" id="select"></input> 	   
      	    	 <input type="hidden" name="courseId" value='<%=request.getParameter("courseId")%>' class="layui-input" style="width:150px">
      	         <input type= "hidden" name="studentId" readonly value='<%=request.getParameter("id") %>' class="layui-input" style="width: 150px;"></input>
      	    </div>
    	         	
      	</div>	
      	
      	<div >
<!--       	   <input type="hidden" name="action" value="page"/> -->
      	   <input type="hidden" name="pageIndex" value="1"/>
      	   <input type="hidden" name="pageLimit" value="10"/>
      	
      	</div>
      </from>
      	
	</fieldset>

	</div>
	
</div>


<div class="layui-form" >

	<table class="layui-table">
		<colgroup>
		   <col width="%10"><col width="15%"><col width="15%">
		   <col width="%10"><col width="15%"><col width="15%">
		</colgroup>
	
		<thead>
			<tr>
			 	<th>序号</th><th>课程编号</th><th>课程名</th>
			 	<th>成绩</th><th>学分绩点</th>
			 	<th>教师</th><th>操作</th>
			 	
			</tr>
		</thead>
		<tbody id="studentScore_tbody">
		
		</tbody>
	</table>
	<div id="pageInfoUser" style="text-align:right;padding-right:30px"></div>

</div>

</body>

<script src="../../static/js/base.js"></script>
<script type="text/javascript">
element.render();


function refresh(){
	$("#select").click();
	
}


	formSubmit("/StudentMangers/ScoreServlet","submit(select)","json",function select(data){
		
	    

	
	    
	   
		var html="";
		
		studentId = data[0].studentId;
	
		$.each(data,function(i,dom){
			i++;	
			var courseId = dom.courseId?dom.courseId+"":"";
			var courseName = dom.courseName?dom.courseName+"":"";
			var gradePoint= dom.gradePoint?dom.gradePoint:"";
			var teacherName1 = dom.teacherName?dom.teacherName+"":"";
			var title=dom.title?dom.title:"";
			var teacherName =teacherName1 +"("+title+")";
			var score = dom.score?dom.score:"";
		
		
			
			
			var d={i:i,courseId:courseId,courseName:courseName,teacherName:teacherName,gradePoint:gradePoint,score:score};
		    var  laytpl = layui.laytpl;
			
			 html +=  laytpl($("#tradd").html()).render(d);
			
			
			  
		})
		$("#studentScore_tbody").html(html);

		

		
	})
	refresh();
	
	
	function update(i,studentId,courseId,courseName,score,gradePoint,teacherName){
		layer.open({
			type:2,
			area:['800px','500px'],
			fixed:false,
			maxmin:true,
			content: "./update.jsp?i="+i+"&studentId="+studentId+"&courseId="+courseId+"&courseName="+courseName+"&teacherName="+teacherName+"&gradePoint="+gradePoint+"&score="+score,
	        end:refresh,
		})
	}				
			
		





</script>


<script type="text/html" id="tradd">
<tr id="tr"+{{d.i}}}>
  <td>{{d.i}}</td>
  <td>{{d.courseId}}</td>
  <td>{{d.courseName}}</td>
  <td>{{d.score}}</td>
  <td>{{d.gradePoint}}</td>
  <td>{{d.teacherName}}</td>
   <td>
 
  <a href="javascript:;"class="layui-btn " lay-submit lay-filter="update" name="action" onclick="update({{d.i}},'<%=request.getParameter("id")%>','{{d.courseId}}','{{d.courseName}}',{{d.score}},{{d.gradePoint}},'{{d.teacherName}}')" value="修改">修改</a>




  </td>
</tr>
</script>





</html>